window.jQuery && !window.handleHeaderProduct && (window.handleHeaderProduct = function() {
    $(".log-dd-trigger").hover(function() {
        $(".u-box").show(),
        $(".log-dropdown").show()
    },
    function() {
        $(".u-box").hide(),
        $(".log-dropdown").hide()
    }),
    $("#headerNav").on("mouseenter", ".nav-header-sub a",
    function() {
        var e = $(this),
        t = e.closest(".nav-header-sub"),
        i = t.find("a");
        i.each(function() {
            $(this)[0] !== e[0] && ($(this).css("opacity", "0.5"), $(this).css("filter", 'alpha(opacity="50")'))
        })
    }).on("mouseleave", ".nav-header-sub a",
    function() {
        var e = $(this),
        t = e.closest(".nav-header-sub"),
        i = t.find("a");
        i.each(function() {
            $(this)[0] != e[0] && ($(this).css("opacity", "1"), $(this).css("filter", 'alpha(opacity="100")'))
        })
    });
    var e, t = $("#headerNav");
    return t.on("mouseover",
    function() {
        e && (clearTimeout(e), e = null)
    }),
    t.on("mouseover", ".nav-header-link > li",
    function() {
        var e = $(this),
        i = $("#nav-header-sub-" + e.data("subnav")),
        o = !!$(".nav-header-sub:visible").length;
        $(".nav-header-sub").hide(),
        e.hasClass("nav-header-link-product") && (o ? i.show() : i.slideDown("fast")),
        t.addClass("toggle")
    }).on("mouseout",
    function() {
        e = setTimeout(function() {
            $(".nav-header-sub").hide(),
            t.removeClass("toggle")
        },
        200)
    }),
    window.navigator.userAgent.indexOf("MSIE 7.0") > -1 && (document.getElementById("headerNav").onclick = function(e) {
        var e = e || window.event,
        t = e.targetElement || e.srcElement;
        return "IMG" === t.tagName.toUpperCase() && t.parentNode.className.indexOf("nav-header-sub-img") > -1 ? (t = t.parentNode.parentNode, window.location.href = t.href, !1) : void 0
    }),
    1
} ()),
$(function() {
    function e() {
        r.toggleClass("open"),
        $(".subnav-menu").slideToggle(200,
        function() {
            l = r.outerHeight()
        })
    }
    var t = $(window),
    i = $(".container"),
    o = $(".nav-header"),
    n = o.outerHeight(),
    a = $("#nav-header-sub"),
    r = $(".subnav"),
    s = $(".toTop"),
    d = $(window).scrollTop(),
    c = 0,
    u = 0,
    l = ($("#nav-header").height(), r.outerHeight()),
    h = r.offset() ? r.offset().top: 0;
    window.getViewport = function() {
        return "BackCompat" == document.compatMode ? {
            width: document.body.clientWidth,
            height: document.body.clientHeight
        }: {
            width: document.documentElement.clientWidth,
            height: document.documentElement.clientHeight
        }
    },
    $(".subnav-disclosure").on("click",
    function() {
        e()
    }),
    setTimeout(function() {
        t.scroll(function() {
            r.hasClass("open") && e()
        })
    },
    2e3),
    window.toggleSubnavMenu = e,
    window.fixSubnav = function(e) {
        var i = !0;
        t.scroll(function() {
            c = t.scrollTop(),
            u = t.scrollLeft(),
            c > h ? r.addClass("fixed").css("left", -u) : r.removeClass("fixed").css("left", 0),
            1 === e && (c > d ? c > h + l ? 1 == i && (i = !1, r.animate({
                top: -l
            },
            200, "linear",
            function() {
                i = !0
            })) : c > h && h + l > c && (r.stop().css({
                top: 0
            }), i = !0) : c > h ? 1 == i && (i = !1, r.animate({
                top: 0
            },
            200, "linear",
            function() {
                i = !0
            })) : d > h && (r.stop().css({
                top: h
            }), i = !0)),
            d = c
        })
    },
    window.hideSiteHeader = function() {
        setTimeout(function() {
            document.getElementsByTagName("body")[0].scrollTop = n
        },
        50)
    },
    t.scroll(function() {
        c = t.scrollTop(),
        900 > c ? s.fadeOut() : s.fadeIn()
    }).resize(function() {
        getViewport().width < 1080 ? (i.addClass("JSWrapperWidth"), r.addClass("JSWrapperWidth"), o.addClass("JSWrapperWidth"), a.css("width", "1080px")) : (i.removeClass("JSWrapperWidth"), r.removeClass("JSWrapperWidth"), o.removeClass("JSWrapperWidth"), a.css("width", "100%"))
    }),
    s.click(function() {
        $("html,body").animate({
            scrollTop: 0
        },
        500)
    }),
    t.scroll().resize()
});